/**
 * 
 */
package com.shequan.activity.service.impl;

import java.util.List;

import com.shequan.activity.bean.pojo.Activity;
import com.shequan.activity.dao.ActivityDAO;
import com.shequan.activity.service.ActivityService;
import com.shequan.common.bean.ResultDataStruct;
import com.shequan.common.bean.ViewTextConstans;
import com.shequan.shequan.bean.bo.HotsActivityBean;

/**
 * <P>
 * Copyright 2012.
 * </p>
 * <P>
 * All Rights Reserved.
 * </p>
 * @author Administrator
 * @version 1.0, 2012-3-29
 * @see com.shequan.activity.service.impl.ActivityServiceImpl 
 * @since 1.0
 */
public class ActivityServiceImpl implements ActivityService {
	private ActivityDAO activitDao;

	public void setActivitDao(ActivityDAO activitDao) {
		this.activitDao = activitDao;
	}

	/* (non-Javadoc)
	 * @see com.shequan.activity.service.ActivityService#queryLastestActivityByUserId(int)
	 */
	public ResultDataStruct<Activity> queryLastestActivityByUserId(int userId) {
		ResultDataStruct<Activity> rds=new ResultDataStruct<Activity>();
		Activity activity=activitDao.selectLastestActivityByUserId(userId);
		if(activity==null){
			rds.setBusiSuccess(false);
			rds.setMessage(ViewTextConstans.ACTIVITY_QUERY_IS_NULL_MSG);
		}else{
			rds.setBusiSuccess(true);
			rds.setData(activity);
		}
		rds.setSuccess(true);
		return rds;
	}

	public List<HotsActivityBean> queryAllHotsActList() throws Exception {
		return activitDao.queryAllHotsActList();
	}
}
